import React, { lazy, Component } from "react";
import { withRouter } from "../../router/hooks";
import { Link } from "react-router-dom";
import "./view.less";
import { withTranslation } from "react-i18next";
const Header = lazy(() =>
  import(/* webpackChunkName:'header' */ "../components/header/index")
);

class View extends Component {
  constructor(props) {
    super(props);
    this.state = {
      newsId: null,
    };
  }
  render() {
    const { t } = this.props;
    return (
      <div className="view">
        <Header
          routeName={t('View')}
          leftSlot={
            <Link to="/">
              <i className="iconfont icon-arrow-left-bold"></i>
            </Link>
          }
        />
        <div className="view_content">View Page {this.state.newsId}</div>
      </div>
    );
  }
  componentDidMount() {
    this.setState({ newsId: this.props.history.get("newid") });
  }
}

export default withRouter(withTranslation()(View));
